﻿using Kingdee.BOS.Core.Bill.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NS
{
    /// <summary>
    /// 【表单插件】基础资料字段禁用F8列表
    /// </summary>
    [Description("【表单插件】基础资料字段禁用F8列表"), HotUpdate]
    public class ForbidF8ListFormPlugIn : AbstractDynamicFormPlugIn
    {
        public override void BeforeF7Select(BeforeF7SelectEventArgs e)
        {
            base.BeforeF7Select(e);
            if (e.IsButtonClick && (e.BaseDataField.Key.EqualsIgnoreCase("FMaterialId")||
                e.BaseDataField.Key.EqualsIgnoreCase("F_WNEG_Base1") || e.BaseDataField.Key.EqualsIgnoreCase("F_WNEG_Base")|| e.BaseDataField.Key.EqualsIgnoreCase("FSupplierId")))
            {
                // 供应商字段禁用F8列表
                e.Cancel = true;
                return;
            }
        }
    }
}
